Nowadays, with the increasing use of various discrete data acquisition methods such as drones and digital cameras, image processing has found wide application. However, video data alone cannot play a significant role in urban management decisions until they are transformed into statistical sequences. In this paper, a system for detecting the number of cars per unit length and time is presented. In this method, video data is converted into statistical sequences of traffic indicators. First, the images corresponding to each frame are modeled into background images based on the Gaussian mixture model, which are resistant to lighting changes. This operation is performed on a large number of frames to create a learned background image. In traditional traffic image processing methods, modeling the background image was not considered, and conversely, in the proposed method, this model is used to detect moving objects. Then, by comparing each input main frame with the learned background image, moving cars are detected. The information on the number of cars per unit length and time, which corresponds to the concepts of traffic volume and density, is used to estimate traffic flow. Based on the simulations performed and the comparison of the obtained results with other results from different studies, the high performance of the proposed method in car detection and accurate counting, considering proper background image training, is demonstrated. Moreover, this method can be used for processing low-quality images.